<?php
/**
 *
 */

use Fox\Msg;
use Fox\SalesDistribution\Sales;
use Fox\Html\DropList,Fox\Html\Input;
use Fox\SalesDistribution\Sales\Inquiry\Type;
use Fox\SalesDistribution\Sales\Inquiry\Status;
use Fox\Generator;
use Common\Agency;
$block = new Fox\Html\Block("bHeader",Msg(Msg::BUNDLE,Msg::MSG_HEADER_DATA));
// Project Name
$block->add(new Input(array("project_name","purchase_name"),true))->size(Input::SIZE_LARGE);
$id = Xview::instance()->val("inquiryid");
// Types
$finder = new Type();
$types = $finder->find();
$block->add(new DropList(array("inquiry_type","type"),true,false,true))
			->options($types,
						Generator::useAttribute('typeid'),
						Generator::useAttribute('label'));
						
// Types
$finder = new Status();

$status = $finder->find(new Fox\Dao\SqlFragment("language = ?",array(Xview::instance()->language())));

$block->add(new DropList("status",false,false,false,1),2)
			->onChange("ReloadFromObject('eInquiry','BC_bItems','?mod=inquiry&act=items','ReloadFromObject(\'bHeader\',\'bFinal\',\'?mod=inquiry&act=final\')')")
			->input(false)
			->labelSize(170)
			->options($status,
						Generator::useAttribute('statusid'),
						Generator::useAttribute('label'))
			;
	
$block->add(new Input(array("propection","reference"),true))->size(Input::SIZE_MEDIUM);
$block->add(new Input(array("emission_date","start_date"),true));

if(!empty($id))
{
	$block->add(new Input(array("date_revised","date_revision"),false),2,"start_date");
	$block->item("date_revision")
				->labelSize(170)
				->label(Msg(Sales::BUNDLE_NAME,32));
}
$block->collapsed(false);
return $block;